package cn.wolfcode.service.impl;


import cn.wolfcode.domain.User;
import cn.wolfcode.mapper.UserMapper;
import cn.wolfcode.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User selectUserByName(String username) {
        User user = userMapper.selectUserByName(username);
        return user;
    }

    @Override
    public User checkName(String username) {
        User user = userMapper.checkName(username);
        return user;
    }

    @Override
    public void register(String username, String password) {
        userMapper.register(username, password);
    }

    @Override
    public void updateKey(Long id, String newPassword) {
        userMapper.updateKey(id, newPassword);
    }
}
